package com.echo.svm;

import weka.classifiers.Evaluation;
import wlsvm.WLSVM;

public class SVMExample{
	public SVMExample()throws Exception
	{
		String dataFile = this.getClass().getResource("/").getPath()+"\\com\\echo\\res\\weather.arff";
		
		WLSVM lib = new WLSVM();
		
		String[] ops = {new String("-t"),
				dataFile,
				new String("-x"),		// 5 folds CV
				new String("5"),
				new String("-i"),		//
				//---------------
				new String("-S"),		// WLSVM options
				new String("0"),		// Classification problem
				new String("-K"),       // RBF kernel
				new String("2"),
				new String("-G"),       // gamma
				new String("1"),
				new String("-C"),       // C
				new String("7"),
				new String("-Z"),       // normalize input data
				new String("1"),
				new String("-M"),       // cache size in MB
				new String("100")				
				};
		
		System.out.println(Evaluation.evaluateModel(lib, ops));
	}
	public static void main(String[] args){
		try{
			SVMExample sm = new SVMExample();
		}catch(Exception e){
			e.printStackTrace();
		}
		
	}
}